//---------------------------------------------------------------------------- // File: C3DIndices.h // Class: C3DIndices [v4]-- Common 3D Vertices Class // Type: 3D Object // Author: Ken Anderson // Date: 3/16/04 // OS dependant: NA // Desc: A class designated to manage both a block of indicies and its // corresponding vertices. // Versions: // 1.0[1/9/06] -- Class created. // Notes: // Required headers: // 1) C3DTypes.h -- Contains structures, error codes, & enumations the class // relies on. // 2) Banks3d.h -- Contains a list of renderbanks used by the common & renderer system. // 3) CRSGlobal.h -- Contains the global CRS Manager. There is only one CRS Manager // per system. // 4) C3DVertices.h -- Contains the vertices class responsible for managing a // block of vertices. //---------------------------------------------------------------------------- #ifndef __C3DINDICES__ #define __C3DINDICES__ #include "C3DTypes.h" #include "C3DVertices.h" #include "Banks3D.h" #include "CRSGlobal.h" class C3DIndices { private: PSC3DIndices m_pIndices; //A pointer to the index pipeline. Dword m_dwCurrIdx; //The current index being loaded. Dword m_dwVertNum; //Number of vertices for quick access. HRBE m_hCallback; //A handle to BEI (Bank Element Indices) for updating. public: //Constructor & Destructor. C3DIndices(); C3DIndices(const C3DIndices& indices); ~C3DIndices(); //Creation/Deletion Functions. C3DERR Create(Dword dwNumIndx, C3DVertices* pVerts); void Clear(); C3DERR SetVertices(C3DVertices* pVerts); C3DERR Render(Byte byStage, Dword dwStartPoint, Dword dwNumVertices, C3DPrimitiveType PrimType); C3DERR Render(Byte byStage); C3DERR Render(); //Primitive Settings. C3DERR SetPrimitiveType(C3DPrimitiveType PrimType); C3DPrimitiveType GetPrimitiveType(); //Performance Modifiers. void Hold(); void ReleaseHold(); C3DERR Index(Dword dwVertex); C3DERR Index(Dword dwIndex, Dword dwVertex); //Get current vertex or vertex at index. Dword ReturnIndicesAmount(); Dword GetIndex(); Dword GetIndex(Dword dwIndex); private: void Cleanup(); C3DERR UpdateIndexBank(PSC3DIndices pI, C3DVertices* pVerts, TRBE trbe); }; #endif